﻿
<script>
    var tempmodel = avalon.define({
        $id: "HTGL",
        name: "合同管理",

        HTTypeData: ["采购", "销售", "其它"],
        modelData: { "HT_Type": "销售", "HT_BianHao": "", "HT_Name": "", "HT_DW": "","HT_QYDate":"", "HT_QDF": "", "HT_ZJE": "", "Files": "", "HT_YXQ": "", "HT_FKFS1": "", "HT_BeiZhu": "" },
        iswf: false,//是否属于流程表单
        inittemp: function (strId) {
            //获取请假类型
            $.getJSON('/API/FTAPI.ashx?Action=GETCOLUMNLIST', { P1: 11 }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    tempmodel.HTGLTypeData = resultData.Result;
                }
            })
            if (strId) {
                //编辑加载数据
                $.getJSON('/API/FTAPI.ashx?Action=GETHTGLMODEL', { P1: strId }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        tempmodel.modelData = resultData.Result;
                        if (tempmodel.modelData.HT_QYDate && tempmodel.modelData.HT_QYDate.length > 10) {
                            tempmodel.modelData.HT_QYDate = tempmodel.modelData.HT_QYDate.substring(0, 10);
                        }

                    }
                })
            }
            setTimeout(" ComFunJS.initForm()", 500)

        },//初始化
        SaveData: function (btdom, piid) {
            var data = tempmodel.modelData.$model;
            var modelValue = JSON.stringify(data);
            $.post("/API/FTAPI.ashx?ACTION=ADDHTGL", { P1: modelValue }, function (result) {
                var jsonresult = $.parseJSON(result)
                btdom.removeClass("disabled").find("i").hide();
                if ($.trim(jsonresult.ErrorMsg) == "") {
                    ComFunJS.winsuccessnew("操作成功");
                }
            });
        },
    });
   
</script>
<div class="form-horizontal" ms-controller="HTGL">
    <div class="form-group">
        <label class="col-xs-2 control-label"> <span class="Required">*</span>  合同类型 </label>
        <div class="col-xs-3">
            <select ms-duplex="modelData.HT_Type" class="form-control">
                <option ms-repeat-item="HTTypeData" ms-attr-value="item">{{item}}</option>
            </select>
        </div> 
        <label class="col-xs-2 control-label">合同编号</label>
        <div class="col-xs-3">
            <input type="text"  ms-duplex="modelData.HT_BianHao" class="form-control szhl_require" />
        </div>
      
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label"> <span class="Required">*</span>  合同名称 </label>
        <div class="col-xs-3">
            <input type="text"  ms-duplex="modelData.HT_Name" class="form-control szhl_require" />

        </div>
        <label class="col-xs-2 control-label"><span class="Required">*</span>合同签订方</label>
        <div class="col-xs-3">
            <input type="text" ms-duplex="modelData.HT_QDF" class="form-control szhl_require" />
        </div>
    </div>
    <!--<div class="form-group">
        <label class="col-xs-2 control-label"> <span class="Required">*</span>  合同单位 </label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.HT_DW" class="form-control szhl_require" />

        </div>
       

    </div>-->
    <div class="form-group">
        <label class="col-xs-2 control-label"> <span class="Required">*</span>  签约时间 </label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.HT_QYDate" class="form-control szhl_require szhl_form_date" />

        </div>
        <label class="col-xs-2 control-label"><span class="Required">*</span>合同金额</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.HT_ZJE" class="form-control szhl_require szhl_Int" />
        </div>

    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">  有效期 </label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.HT_YXQ" class="form-control " />

        </div>
        <label class="col-xs-2 control-label">付款方式</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.HT_FKFS1" class="form-control " />
        </div>

    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">备注</label>
        <div class="col-xs-8">
            <textarea id="conRemark" ms-duplex="modelData.HT_BeiZhu" class="szhl_UEEDIT form-control " umheight="100"></textarea>
        </div>
    </div> 
    <div class="form-group">
        <label class="col-xs-2 control-label">附件</label>
        <div class="col-xs-8">
            <input type="text" value="" class="span2  szhl_Upload form-control" ms-duplex="modelData.Files"  />
        </div>
    </div>
</div>
